package com.ruoyi.zjext.beans;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 菜单信息
 * @author xi.yang
 * @create 2020-10-23 14:31
 **/
public class MenuInfo implements Serializable {
    /**
     * md5(parentTags+tag)
     */
    private String id;
    /**
     * 层级
     */
    private int level;
    /**
     * 路径标识
     */
    private String tag;
    /**
     * 目录名
     */
    private String title;
    private String icon;
    /**
     * 增删改查(搜索)1248
     */
    private int func;
    private List<MenuInfo> children = new ArrayList<>();

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getTag() {
        return tag;
    }

    public List<MenuInfo> getChildren() {
        return children;
    }

    public void setChildren(List<MenuInfo> children) {
        this.children = children;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public int getFunc() {
        return func;
    }

    public void setFunc(int func) {
        this.func = func;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static final class Builder {
        private int level;
        private String tag;
        private String title;
        private String icon;

        private int func;

        private Builder() {
        }

        public Builder level(int level) {
            this.level = level;
            return this;
        }

        public Builder tag(String tag) {
            this.tag = tag;
            return this;
        }

        public Builder title(String title) {
            this.title = title;
            return this;
        }

        public Builder icon(String icon) {
            this.icon = icon;
            return this;
        }

        public Builder func(int func) {
            this.func = func;
            return this;
        }

        public MenuInfo build() {
            MenuInfo menuInfo = new MenuInfo();
            menuInfo.setLevel(level);
            menuInfo.setTag(tag);
            menuInfo.setTitle(title);
            menuInfo.setIcon(icon);
            menuInfo.setFunc(func);
            return menuInfo;
        }
    }
}
